<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>3_事件传参</title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <div id="demo">
            <button @click="showMsg1('Vue 你要加油呀')">点我提示信息1</button>
            <button @click="showMsg2(666,777)">点我提示信息2</button>
            <button @click="showMsg3($event,888)">点我提示信息3</button>
            <button @click="showMsg4(name)">点我提示信息4</button>
        </div>
    </body>

    <script type="text/javascript">
        Vue.config.productionTip = false;

        new Vue({
            el: '#demo',
            data: {
                name: '尚硅谷',
                address: '宏福科技园'
            },
            methods: {
                showMsg1(massage){
                    alert(`同学你好!${massage}`)
                },
                showMsg2(a,b){
                    alert(`同学你好!${a},${b}`)
                },
                showMsg3(n){
                    alert(`同学你好!${n}`)
                },
                showMsg4(name){
                    alert(`学校名：${name}，地址：${this.address}!`)
                },

            }
        })
        
    </script>
</html>